<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>粘性定位</title>
  <style>
    *{
      padding: 0;
      margin: 0;
    }
    body{
      height: 10000px;
    }
    .page-header{
      height: 100px;
      background-color: orange;
      text-align: center;
      line-height: 100px;
    }
    .item{
      background-color: gray;
    }
    .first{
      background-color: skyblue;
      position: sticky;
      top: 0;
      font-size: 20px;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="page-header">头部</div>
    <div class="content">
      <div class="item">
        <div class="first">A</div>
        <h2>A1</h2>
        <h2>A2</h2>
        <h2>A3</h2>
        <h2>A4</h2>
        <h2>A5</h2>
        <h2>A6</h2>
      </div>
      <div class="item">
        <div class="first">B</div>
        <h2>B1</h2>
        <h2>B2</h2>
        <h2>B3</h2>
        <h2>B4</h2>
        <h2>B5</h2>
        <h2>B6</h2>
      </div>
      <div class="item">
        <div class="first">C</div>
        <h2>C1</h2>
        <h2>C2</h2>
        <h2>C3</h2>
        <h2>C4</h2>
        <h2>C5</h2>
        <h2>C6</h2>
      </div>
    </div>

  </div>
</body>
</html>